package main

import (
	"database/sql"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

type Test struct {
	gorm.Model
	Name string
}

func mysql_() {
	url := "root:123456@tcp(127.0.0.1:3306)/mimiwang"

	//原生sql
	open, _ := sql.Open("mysql", url)
	open.Query("")
	open.Exec("")
	//gorm sql
	db, _ := gorm.Open(mysql.Open(url), &gorm.Config{})
	db.Find("")
	db.Delete("")
	db.Updates("")
	db.Create("")
}
